import request from '@/utils/request'

// 查询活动列表
export function listActivity (query) {
  return request({
    url: '/angel/activity/list',
    method: 'get',
    params: query
  })
}

// 查询活动详细
export function getActivity (activityId) {
  return request({
    url: '/angel/activity/' + activityId,
    method: 'get'
  })
}

// 查询活动名称
export function getActivityByName (activityName) {
  return request({
    url: '/angel/activity/getByName/' + activityName,
    method: 'get'
  })
}

// 新增活动
export function addActivity (data) {
  return request({
    url: '/angel/activity',
    method: 'post',
    data: data
  })
}

// 修改活动
export function updateActivity (data) {
  return request({
    url: '/angel/activity',
    method: 'put',
    data: data
  })
}

// 删除活动
export function delActivity (activityId) {
  return request({
    url: '/angel/activity/' + activityId,
    method: 'delete'
  })
}

// 导出活动
export function exportActivity (query) {
  return request({
    url: '/angel/activity/export',
    method: 'get',
    params: query
  })
}

// 获取活动参加人员
export function getActivityMember (activityId) {
  return request({
    url: '/angel/activity/getActivityMember/' + activityId,
    method: 'get'
  })
}

// 移除参加活动中的人员
export function removeMemberAtActivity (memberId, activityId) {
  return request({
    url: `/angel/activity/removeMemberAtActivity/${memberId}/${activityId}`,
    method: 'delete'
  })
}
